\newcommand\tablepdf[6]{
  \begin{table}[!h]
    \caption{#2}
    \includegraphics[page=#4,width=1.012\textwidth,height=0.9\textheight,keepaspectratio,center]{#3}
    \label{tab:#1}
  \end{table}

  \vspace{-12mm}
  {\ifthenelse{\isempty{#6}}{\footnotesize}{#6} \singlespacing \ifthenelse{\isempty{#5}}{}{\textit{Notes:} #5} \par}

  \clearpage
}

\newcommand\onepanelfig[4]{

  \begin{figure}[!h]
          \caption{#2}
          \centering
          \includegraphics[width=0.9\textwidth]{#3}
          \label{fig:#1}
  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#4}}{}{\textit{Notes:} #4} \par}

  \clearpage

}

\newcommand\twopanelwidefig[9]{

  \begin{figure}[!h]
    \caption{#2}
    \label{fig:#1}
    \centering

    \begin{subfigure}[t]{\textwidth}
            \vspace{3mm}
            \caption{#5}
            \label{fig:#4}
            \includegraphics[width=\textwidth]{#3}
    \end{subfigure}

    \begin{subfigure}[t]{\textwidth}
            \vspace{6mm}
            \caption{#8}
            \label{fig:#7}
            \includegraphics[width=\textwidth]{#6}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#9}}{}{\textit{Notes:} #9} \par}

  \clearpage

}

\newcommand\twopanelfig[9]{

  \begin{figure}[!h]
    \caption{#2}
    \label{fig:#1}
    \centering

    \begin{subfigure}[t]{0.65\textwidth}
            \vspace{3mm}
            \caption{#5}
            \label{fig:#4}
            \includegraphics[width=\textwidth]{#3}
    \end{subfigure}

    \begin{subfigure}[t]{0.65\textwidth}
            \vspace{6mm}
            \caption{#8}
            \label{fig:#7}
            \includegraphics[width=\textwidth]{#6}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#9}}{}{\textit{Notes:} #9} \par}

  \clearpage

}

\newcommand\twopanelnarrowfig[9]{

  \begin{figure}[!h]
    \caption{#2}
    \label{fig:#1}
    \centering

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#5}
            \label{fig:#4}
            \includegraphics[width=\textwidth]{#3}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#8}
            \label{fig:#7}
            \includegraphics[width=\textwidth]{#6}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#9}}{}{\textit{Notes:} #9} \par}

  \clearpage

}

\newcommand\threepanelfig[9]{
  \def\tempa{#1}
  \def\tempb{#2}
  \def\tempc{#3}
  \def\tempd{#4}
  \def\tempe{#5}
  \def\tempf{#6}
  \def\tempg{#7}
  \def\temph{#8}
  \def\tempi{#9}
  \threepanelfigcont
}

\newcommand\threepanelfigcont[3]{

  \begin{figure}[!h]
    \caption{\tempb}
    \label{fig:\tempa}
    \centering

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\tempe}
            \label{fig:\tempd}
            \includegraphics[width=\textwidth]{\tempc}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\temph}
            \label{fig:\tempg}
            \includegraphics[width=\textwidth]{\tempf}
    \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#2}
            \label{fig:#1}
            \includegraphics[width=\textwidth]{\tempi}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#3}}{}{\textit{Notes:} #3} \par}

  \clearpage

}

\newcommand\flippedthreepanelfig[9]{
  \def\tempa{#1}
  \def\tempb{#2}
  \def\tempc{#3}
  \def\tempd{#4}
  \def\tempe{#5}
  \def\tempf{#6}
  \def\tempg{#7}
  \def\temph{#8}
  \def\tempi{#9}
  \flippedthreepanelfigcont
}

\newcommand\flippedthreepanelfigcont[3]{

  \begin{figure}[!h]
    \caption{\tempb}
    \label{fig:\tempa}
    \centering

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\tempe}
            \label{fig:\tempd}
            \includegraphics[width=\textwidth]{\tempc}
    \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\temph}
            \label{fig:\tempg}
            \includegraphics[width=\textwidth]{\tempf}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#2}
            \label{fig:#1}
            \includegraphics[width=\textwidth]{\tempi}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#3}}{}{\textit{Notes:} #3} \par}

  \clearpage

}

\newcommand\ThreePanelFigCustomWidth[9]{
  \def\tempa{#1}
  \def\tempb{#2}
  \def\tempc{#3}
  \def\tempd{#4}
  \def\tempe{#5}
  \def\tempf{#6}
  \def\tempg{#7}
  \def\temph{#8}
  \def\tempi{#9}
  \ThreePanelFigCustomWidthCont
}

\newcommand\ThreePanelFigCustomWidthCont[7]{

  \begin{figure}[!h]
    \caption{\tempb}
    \label{fig:\tempa}
    \centering

    \begin{subfigure}[t]{\tempf}
            \vspace{3mm}
            \caption{\tempe}
            \label{fig:\tempd}
            \includegraphics[width=\textwidth]{\tempc}
    \end{subfigure}
    \begin{subfigure}[t]{#1}
            \vspace{3mm}
            \caption{\tempi}
            \label{fig:\temph}
            \includegraphics[width=\textwidth]{\tempg}
    \end{subfigure}
    \begin{subfigure}[t]{#5}
            \vspace{3mm}
            \caption{#4}
            \label{fig:#3}
            \includegraphics[width=\textwidth]{#2}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\ifthenelse{\isempty{#7}}{\footnotesize}{#7} \singlespacing \ifthenelse{\isempty{#6}}{}{\textit{Notes:} #6} \par}

  \clearpage

}

\newcommand\ThreePanelFigWideMiddle[9]{
  \def\tempa{#1}
  \def\tempb{#2}
  \def\tempc{#3}
  \def\tempd{#4}
  \def\tempe{#5}
  \def\tempf{#6}
  \def\tempg{#7}
  \def\temph{#8}
  \def\tempi{#9}
  \ThreePanelFigWideMiddleCont
}

\newcommand\ThreePanelFigWideMiddleCont[6]{

  \begin{figure}[!h]
    \caption{\tempb}
    \label{fig:\tempa}
    \centering

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\tempe}
            \label{fig:\tempd}
            \includegraphics[width=\textwidth]{\tempc}
    \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{\textwidth}
            \vspace{3mm}
            \caption{#2}
            \label{fig:#1}
            \begin{subfigure}[t]{0.495\textwidth}
            \centering
            \vspace{3mm}
            \caption*{\tempi}
            \includegraphics[width=\textwidth]{\temph}
            \end{subfigure}
            \begin{subfigure}[t]{0.495\textwidth}
            \centering
            \vspace{3mm}
            \caption*{\tempg}
            \includegraphics[width=\textwidth]{\tempf}
            \end{subfigure}    
     \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#5}
            \label{fig:#4}
            \includegraphics[width=\textwidth]{#3}
    \end{subfigure}

  \end{figure}
  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#4}}{}{\textit{Notes:} #6} \par}

  \clearpage

}

\newcommand\fourpanelfig[9]{
  \def\tempa{#1}
  \def\tempb{#2}
  \def\tempc{#3}
  \def\tempd{#4}
  \def\tempe{#5}
  \def\tempf{#6}
  \def\tempg{#7}
  \def\temph{#8}
  \def\tempi{#9}
  \fourpanelfigcont
}

\newcommand\fourpanelfigcont[6]{

  \begin{figure}[!h]
    \caption{\tempb}
    \label{fig:\tempa}
    \centering

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\tempe}
            \label{fig:\tempd}
            \includegraphics[width=\textwidth]{\tempc}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\temph}
            \label{fig:\tempg}
            \includegraphics[width=\textwidth]{\tempf}
    \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#2}
            \label{fig:#1}
            \includegraphics[width=\textwidth]{\tempi}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#5}
            \label{fig:#4}
            \includegraphics[width=\textwidth]{#3}
    \end{subfigure}

  \end{figure}

  \vspace{-5mm}
  {\footnotesize \singlespacing \ifthenelse{\isempty{#6}}{}{\textit{Notes:} #6} \par}

  \clearpage

}

\newcommand\sixpanelfig[9]{
  \def\tempa{#1}
  \def\tempb{#2}
  \def\tempc{#3}
  \def\tempd{#4}
  \def\tempe{#5}
  \def\tempf{#6}
  \def\tempg{#7}
  \def\temph{#8}
  \def\tempi{#9}
  \sixpanelfigcont
}

\newcommand\sixpanelfigcont[6]{

  \begin{figure}[!h]
    \caption{\tempb}
    \label{fig:\tempa}
    \centering

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\tempd}
            \includegraphics[width=\textwidth]{\tempc}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\tempf}
            \includegraphics[width=\textwidth]{\tempe}
    \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{\temph}
            \includegraphics[width=\textwidth]{\tempg}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#1}
            \includegraphics[width=\textwidth]{\tempi}
    \end{subfigure}

    \vskip\baselineskip

    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#3}
            \includegraphics[width=\textwidth]{#2}
    \end{subfigure}
    \begin{subfigure}[t]{0.495\textwidth}
            \vspace{3mm}
            \caption{#5}
            \includegraphics[width=\textwidth]{#4}
    \end{subfigure}

  \end{figure}

  \vspace{-5mm}
  {\scriptsize \singlespacing \ifthenelse{\isempty{#6}}{}{\textit{Notes:} #6} \par}

  \clearpage

}
